<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\GkyQyhDepartment */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="gky-qyh-department-form">
    <div class="panel panel-default">
        <div class="panel-body">
            <?php
            $form = ActiveForm::begin([
                        'options' => ['class' => 'form-horizontal form-group'],
                        'fieldConfig' => [
                            'template' => "{label}<div class=\"col-lg-8\">{input}</div>",
                            'labelOptions' => ['class' => 'col-lg-4', 'style' => 'margin-right:-30px'],
                        ]
            ]);
            ?>

            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">

                <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
            </div>
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?php
                $data = \app\models\GkyQyhDepartment::find()->all();
                echo $form->field($model, 'parentid')->dropDownList(
                        \yii\helpers\ArrayHelper::map($data, 'id', 'name'), ['prompt' => '请选择父级菜单'])->label('父级名称');
                ?>


            </div>
<!--            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?php // echo $form->field($model, 'order')->textInput() ?>
            </div>-->
            <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                <?php
                $data = \app\models\GkyQyh::find()->all();
                echo $form->field($model, 'qyh_id')->dropDownList(
                        \yii\helpers\ArrayHelper::map($data, 'id', 'qyhname'), ['prompt' => '请选择企业号'])->label('企业号');
                ?>
            </div>
            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
                <div class="form-group">
                    <?= Html::submitButton('保存', ['class' => 'btn btn-success col-lg-offset-5 col-md-offset-5']) ?>
                    <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
                </div>
            </div>

            <?php ActiveForm::end(); ?>
        </div>
    </div>

</div>
